package student.service;

import student.StudentService;
import student.dao.StudentDao;
import student.entity.Student;


import java.util.Scanner;

public class StudentServiceImpl implements StudentService {


    @Override
    public void studentMenu(){
        while (true) {
            System.out.println("****************************************");
            System.out.println("      欢迎使用仁爱学院教务管理系统（学生端）");
            System.out.println("                1.个人信息");
            System.out.println("                2.修改个人信息");
            System.out.println("                3.个人课表");
            System.out.println("                4.个人成绩");
            System.out.println("                5.退出");

            System.out.println("****************************************");
            System.out.print("请输入你的选择：");
            Scanner scanner = new Scanner(System.in);
            String next = scanner.next();
            switch (next) {
                case "1":
                    System.out.println("正在进入个人信息");
                    new StudentDao().studentSelect();
                    break;
                case "2":
                    System.out.println("您可以修改个人信息");
                    studentRevise();
                    break;
                case "3":
                    System.out.println("正在加载个人课表");
                    new StudentDao().studentClass();
                    break;
                case "4":
                    System.out.println("正在查询个人成绩");
                    new StudentDao().studentGrade();
                    break;
                case "5":
                    return;

                default:
            }
        }
    }
     @Override
             public void studentRevise(){
     System.out.println("------修改个人信息------");
    Scanner scanner=new Scanner(System.in);
    Student student= new Student();
    System.out.println("请输入学生id：");
    String studentId=scanner.next();
    student.setStudentId(studentId);
        System.out.println("请输入用户姓名：");
    String studentName = scanner.next();
        student.setStudentName(studentName);
        System.out.println("请输入用户性别：");
    String studentSex = scanner.next();
        student.setStudentSex(studentSex);
        System.out.println("请输入用户年龄：");
    String studentAge = scanner.next();
        student.setStudentAge(studentAge);
        System.out.println("请输入用户班级：");
    String studentClass = scanner.next();
    student.setStudentClass(studentClass);
     new StudentDao().studentRevise(student);
}
}